// 禁止弹窗滑动穿透
var scrollTop;
var domClass = "modal-open";
var ModalHelper = {
  // 弹窗出现
  afterOpen: function () {
    scrollTop = document.scrollingElement.scrollTop;
    document.body.classList.add(domClass);
    document.body.style.top = -scrollTop + 'px';
  },
  // 弹窗消失
  beforeClose: function () {
    document.body.classList.remove(domClass);
    // scrollTop lost after set position:fixed, restore it back.
    document.scrollingElement.scrollTop = scrollTop;
  }
};
export default ModalHelper;
